<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

</head>
<style>
  .main{
    width: 480px;
    margin: 0 auto;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
  }
  .tabBody{
    margin-bottom: 10px;
  }
  .tabMain:after{
    content: "";
    display: block;
    clear: both;
    overflow: hidden;
  }
  .tabMain{
    height: 37px;
    bottom: -1px;
    position: relative;
  }

  .tab{
    width: 25%;
    height: 36px;
    line-height: 36px;
    float: left;
    text-align: center;
    background: #fff;
    margin-right: 5px;
    border: 1px solid #d1dbe5;
    cursor: pointer;
    border-radius: 4px 4px 0 0;
  }
  .tabActive{
    color: #00a2d4;
    border-bottom: 1px solid transparent;
  }
  .mainCard{
    width: 480px;
    margin: 0 auto;
    margin-top: -10px;
    padding: 30px 0px;
    font-size: 14px;
    border: 1px solid #d1dbe5;
    border-radius: 0 4px 4px 4px;
    background-color: #fff;
    overflow: hidden;
    box-shadow: 2px 2px 4px 0 rgba(0,0,0,.12), 0 0 6px 0 rgba(0,0,0,.04);
    display: none;
  }
  .mainCardActive{
    display: block;
  }
  .btn{
    width: 50%;
    margin: 0 auto;
  }
  .btn>button{
    width: 100%;
    height: 36px;
    outline:none;
    cursor: pointer;
    display: inline-block;
    margin-top: 10%;
    margin-bottom: 0;
    font-weight: 400;
    text-align: center;
    vertical-align: middle;
    -ms-touch-action: manipulation;
    touch-action: manipulation;
    cursor: pointer;
    background-image: none;
    border: 1px solid transparent;
    white-space: nowrap;
    line-height: 1.5;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    padding: 6px 15px;
    font-size: 14px;
    border-radius: 4px;
    transition: color .2s linear,background-color .2s linear,border .2s linear;
    color: #495060;
    background-color: #f7f7f7;
    border-color: #dddee1;
  }
  .btnLogin{
    color: #fff;
    background-color: #2d8cf0;
    border-color: #2d8cf0;
  }
  .btnRegister{
    color: #495060;
    background-color: transparent;
    border-color: #dddee1;
  }
  .cardInput{
    width: 86%;
    margin: 10px auto;

  }
  .cardInput>label{
    width: 14%;
    display: inline-block;
  }
  .cardInput>input{
    display: inline-block;
    width: 80%;
    height: 32px;
    line-height: 1.5;
    padding: 4px 7px;
    font-size: 12px;
    border: 1px solid #d1dbe5;
    border-radius: 4px;
    color: #495060;
    background-color: #fff;
    background-image: none;
    position: relative;
    cursor: text;
    transition: border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out;
  }
</style>
<body>
<div class="main">
  <div class="tabBody">
    <div class="tabMain" id="tabMain">
      <div class="tab tabActive">登录</div>
      <div class="tab">注册</div>
    </div>
  </div>
  <div class="mainCard mainCardActive">
    <div class="card">
      <div class="cardInput">
        <label>用户名</label>
        <input type="text" value="">
      </div>
      <div class="cardInput">
        <label>密码</label>
        <input type="text" value="">
      </div>
    </div>
    <div class="btn">
      <button class="btnLogin">登录</button>
    </div>
  </div>
  <div class="mainCard">
    <div class="card">
      <div class="cardInput">
        <label>用户名</label>
        <input type="text" value="">
      </div>
      <div class="cardInput">
        <label>密码</label>
        <input type="text" value="">
      </div>
    </div>
    <div class="btn">
      <button class="btnRegister">注册</button>
    </div>
  </div>
</div>

</body>
<script>
</script>
</html>
